cd ""
clear 
set more off

clear
use first_wave_clean
sort resp_token
* matching dictionary to connect the two waves
merge 1:1 resp_token using id_matching
drop _merge
*** for low quality observations excluded by Dynata in the first wave, give them a random identifier so that they have a unique ID associated with them and the merge works 
replace pid="." if pid=="#N/A"
destring pid, replace
replace pid=_n if pid==.
sort pid
merge 1:1 pid using second_wave_clean
drop if _merge==2
drop _merge
rename w2_dynata_outliers dynata_outliers_w2
save data_survey_merged, replace